import React,{Component} from 'react';
import { Button, Spin} from 'antd';
class MovieDetail extends Component {
    constructor(){
        super();
        this.state={
            movieInfo:{}, //电影详情
            isLoading: true //loading 默认显示
        }
    }
    render(){
        // const info = this.state.movieInfo;
        return (
            <div>
               {/* 返回上一页 */}
               <Button type="后退" onClick={()=>this.props.history.go(-1)} style={{margin: "5px 0 10 5px!important"}}>Primary</Button><br/>
                {
                this.state.isLoading?  <div style={{textAlign: 'center',marginTop: '10px'}}><Spin size="large" /></div> : <div>
                    {/* 因为页面加载可能数据慢需要 判断 */}
                {/* <img src={info.image && info.image.large}></img> */}
                电影详情--{this.props.match.params.id}
                </div>
                }
            </div>
        )
    }

    componentDidMount(){
        setTimeout(()=>{
            this.getMovieList();
        },3000)

    }

    getMovieList=async()=>{
        // const res = await this.$http(this.baseURL+''+this.props.match.params.id)
        //   const data = await res.json();
          this.setState({
            //   movieInfo: data
            isLoading: false
          });
   }
}


export default MovieDetail;